package com.ecloud.openapi.security.convert;

import java.util.List;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

import com.ecloud.openapi.security.dto.BaseMenuDto;
import com.ecloud.openapi.security.po.BaseMenuPo;
import com.ecloud.openapi.security.vo.BaseMenuVo;

/**
 * BaseMenuConvert 模型转换
 *
 * @author LiuGangQiang Create in 2021/07/04
 */
@Mapper
public interface BaseMenuConvert {
    BaseMenuConvert INSTANCE = Mappers.getMapper(BaseMenuConvert.class);

    /**
     * {@link BaseMenuDto}对象 >> {@link BaseMenuPo}对象
     *
     * @author LiuGangQiang Create in 2021/07/04
     * @param dto 入参
     * @return {@link BaseMenuPo} 对象
     */
    BaseMenuPo dtoToPo(BaseMenuDto dto);

    /**
     * {@link BaseMenuDto}集合 >> {@link BaseMenuPo}集合
     *
     * @author LiuGangQiang Create in 2021/07/04
     * @param dtos 入参
     * @return {@link BaseMenuPo} 集合
     */
    List<BaseMenuPo> dtoToPo(List<BaseMenuDto> dtos);

    /**
     * {@link BaseMenuPo}对象 >> {@link BaseMenuVo}对象
     *
     * @author LiuGangQiang Create in 2021/07/04
     * @param dto 入参
     * @return {@link BaseMenuVo} 对象
     */
    @Mapping(target = "pname", ignore = true)
    BaseMenuVo poToVo(BaseMenuPo po);

    /**
     * {@link BaseMenuPo}集合 >> {@link BaseMenuVo}集合
     *
     * @author LiuGangQiang Create in 2021/07/04
     * @param dtos 入参
     * @return {@link BaseMenuVo} 集合
     */
    List<BaseMenuVo> poToVo(List<BaseMenuPo> pos);
}
